
# enforce max stops
# simplification: the flow conservation constraints make sure that 
# all intermediate nodes have net zero flow. This means that to count
# stops, we just need to count the number of intermediate nodes with 
# incoming or outgoing flow; we don't need to check both

subject to c_max_stops:
sum {i in nodes diff {source, dest}} sum {(i,j,k,l) in ARCS} itinerary[i,j,k,l] <= p_max_stops;

# sum {i in nodes diff {source, dest}} (sum {(i,j,k,l) in ARCS} itinerary[i,j,k,l]
# + sum {(m,i,n,o) in ARCS} itinerary[m,i,n,o])
# <= 2*p_max_stops;
